<?php

// uncomment the following to define a path alias
// Yii::setPathOfAlias('local','path/to/local-folder');

// This is the main Web application configuration. Any writable
// CWebApplication properties can be configured here.
return array(
	'basePath'=>dirname(__FILE__).DIRECTORY_SEPARATOR.'..',
	'name'=>'3d cool',
	'language'=>'zh_cn',
	'timeZone' => 'Asia/Shanghai',
	// preloading 'log' component
	'preload'=>array('log'),

	// autoloading model and component classes
	'import'=>array(
		'application.models.*',
		'application.components.*',
		//DWZ 
		'application.extensions.dwz.*',
		'application.modules.user.models.*',
         'application.modules.user.components.*',
		'application.extensions.nestedset.*',
	),

	// application components
	'components'=>array(
		'user'=>array(
                        // enable cookie-based authentication
                        'allowAutoLogin'=>true,
                        'loginUrl' => array('/user/login'),
                ),
		'db'=>array(
			'connectionString' => 'mysql:host=localhost;dbname=3dcool',
			'emulatePrepare' => true,
			'username' => 'root',
			'password' => '',
			'charset' => 'utf8',
			'tablePrefix' => 'tbl_',
		),
		'cache'=>array(
			'class'=>'system.caching.CFileCache',
			'directoryLevel'=>'2',
		),
		'errorHandler'=>array(
			// use 'site/error' action to display errors
            'errorAction'=>'site/error',
        ),
		'log'=>array(
			'class'=>'CLogRouter',
			'routes'=>array(
				array(
					'class'=>'CFileLogRoute',
					'levels'=>'error, warning',
				),
				// uncomment the following to show log messages on web pages
				/*
				array(
					'class'=>'CWebLogRoute',
				),
				*/
			),
		),
		'urlManager'=>array(
        	'urlFormat'=>'path',
        	'showScriptName'=>false,
        	'rules'=>array(
        		'article/<id:\d+>/<title:.*?>'=>'article/view',
        		'articles/<tag:.*?>'=>'article/index',
        		'<controller:\w+>/<action:\w+>'=>'<controller>/<action>',
        	),
        ),
	),

	'modules'=>array(
		'rights',
		'user',
		'admin',
		'gii'=>array(
			'class'=>'system.gii.giiModule',
			'password'=>'admin',
			'generatorPaths'=>array(
				'ext.dwz.gii', //可以继续配置其他路径
            ),
		),
    ),
    
	// application-level parameters that can be accessed
	// using Yii::app()->params['paramName']
	'params'=>require(dirname(__FILE__).'/params.php'),
);
